import instance from '@/utils/http'
const module={
    namespaced:true,//开启命名空间
    state:{
        dataList:[]
    },
    getters:{
        topDateList(state){
        return state.dataList.splice(0,5)
    },
    },
    mutations:{
        setCinemaList(state,data){
            state.dataList=data
          }
    },
    actions:{
        getCinemaActions(store,cityId){
            instance.get(`/gateway?cityId=${cityId}&ticketFlag=1&k=6136987`,{
              headers:{
                  'X-Host': 'mall.film-ticket.cinema.list'
              }
          }).then(res=>{
              store.commit("setCinemaList",res.data.data.cinemas)
          })
      }
  
    }
}
export default module